package com.geoboard.service;

import android.util.Log;
import android.widget.Toast;

import com.android.volley.Response;
import com.geoboard.entity.Board;
import com.geoboard.fragments.MapFrag;

public class PostBoardListener implements Response.Listener<Board>{

	/**** Members **************************************************/
	private String TAG = this.getClass().getSimpleName();
	private MapFrag mMapFrag;
	
	public PostBoardListener (MapFrag mapFrag) {
		mMapFrag = mapFrag;
	}
	
	@Override
	public void onResponse(Board board) {
		Log.d(TAG, "successful post");
        Toast.makeText(mMapFrag.getActivity(),
        		"Board posted", Toast.LENGTH_SHORT).show();
        mMapFrag.getRevealedBoards()
        		.get(board.getZoom())
        		.add(board);
        mMapFrag.displayBoards();
	}

}
